//
//  TeacherCheckTableViewCell.m
//  LoveDraw
//
//  Created by 零零壹 on 2017/8/11.
//  Copyright © 2017年 梁晨. All rights reserved.
//

#import "TeacherCheckTableViewCell.h"

@implementation TeacherCheckTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {

        self.leftYear = [[UILabel alloc]init];
        self.leftYear.font = [UIFont systemFontOfSize:16];
        self.leftYear.textAlignment = 1;
        [self.contentView addSubview:self.leftYear];

        self.leftMonth = [[UILabel alloc]init];
        self.leftMonth.font = [UIFont systemFontOfSize:12];
        [self.leftMonth setTextColor:[UIColor grayColor]];
        self.leftMonth.textAlignment = 1;
        [self.contentView addSubview:self.leftMonth];


        self.lineView = [[UIView alloc]init];
        [self.lineView setBackgroundColor:UIColors(0xEFEFEF)];
        [self.contentView addSubview:self.lineView];

        self.bottomLineView = [[UIView alloc]init];
        [self.bottomLineView setBackgroundColor:UIColors(0xEFEFEF)];
        [self.contentView addSubview:self.bottomLineView];

        self.leftImage = [[UIImageView alloc]init];
        [self.contentView addSubview:self.leftImage];

        self.titleLabel = [[UILabel alloc]init];
        self.titleLabel.font = [UIFont systemFontOfSize:16];
        [self.contentView addSubview:self.titleLabel];
        self.remarkLabel = [[UILabel alloc]init];
        self.remarkLabel.font = [UIFont systemFontOfSize:13];
        self.remarkLabel.textColor = UIColors(0x666666);
        self.remarkLabel.numberOfLines = 2;
        [self.contentView addSubview:self.remarkLabel];
        
    }
    return self;
}


-(void)layoutSubviews
{
    [super layoutSubviews];

    [self.leftYear mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(5);
        make.top.equalTo(self.contentView.mas_top).offset(10);
        make.width.mas_equalTo(50);
        make.height.mas_equalTo(20);
    }];
    [self.leftMonth mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(5);
        make.top.equalTo(self.leftYear.mas_bottom);
        make.width.mas_equalTo(50);
        make.height.mas_equalTo(20);
    }];

    [self.leftImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.leftYear.mas_right).offset(0);
        make.top.mas_equalTo(20);
        make.height.mas_equalTo(16);
        make.width.mas_equalTo(16);
    }];

    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).offset(0);
        make.left.mas_equalTo(62);
        make.width.mas_equalTo(1);
        make.bottom.equalTo(self.leftImage.mas_top);
    }];

    [self.bottomLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.leftImage.mas_bottom).offset(0);
        make.left.mas_equalTo(62);
        make.width.mas_equalTo(1);
        make.bottom.equalTo(self.contentView.mas_bottom);
    }];

    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.leftImage.mas_right).offset(5);
        make.top.mas_equalTo(8);
        make.right.equalTo(self.contentView.mas_right).offset(-5);
    }];

    [self.remarkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.leftImage.mas_right).offset(5);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(5);
        make.right.equalTo(self.contentView.mas_right).offset(-5);
    }];
}


@end
